<!DOCTYPE html>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
    <meta charset="utf-8"/>
    <title>厅干部平时考核管理系统</title>
    <link rel="stylesheet" type="text/css" href="<c:url value='/resource/jxkh/css/main.css'/>"/>
    <script type="text/javascript" src="<c:url value='/resource/jxkh/js/jquery-1.11.0.js'/>"></script>
    <script type="text/javascript" src="<c:url value='/resource/jxkh/js/jquery.form.js'/>"></script>
    <!--弹出框-->
    <script type="text/javascript" src="<c:url value='/resource/jxkh/js/layer/layer.js'/>" ></script>
    <script>
        function submitForm() {
            $("#submit_form").ajaxSubmit({
                type: "post",
                dataType: "json",
                success: function (data) {
                    if (data.data.status == 1) {
                        parent.$('#boot_table').bootstrapTable('refresh');
                        parent.showMessage("操作成功！");
                        var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                        parent.layer.close(index);
                    } else {
                        parent.showMessage(data.data.body);
                    }
                },
                error: function () {
                    parent.showMessage("失败！");
                }
            });
        }
        function showMessage(content) {
            layer.open({
                title: '信息'
                , content: content
            });
        }
        $(function(){
            //下拉框
            $(document).click(function() {
                $(".row_select_xl").slideUp(200);
                $(".khybj_select_xl").slideUp(200);
            });
            $(".row_select").click(function(e) {
                e = e || window.event;
                if(e.stopPropagation) {
                    e.stopPropagation();
                } else {
                    e.cancelBubble = true;
                }
                $(this).children(".row_select_xl").slideToggle(200);
                $(this).parents("td").siblings("td").find(".row_select_xl").hide();
                var selecttext = $(this).children("p");
                var selectmain = $(this).children(".row_select_xl");
                var lis = selectmain.find('li');
                for(var i = 0; i < lis.length; i++) {
                    lis[i].onclick = function() {
                        selectmain.hide();
                        var textval = $(this).html();
                        selecttext.text(decodeURIComponent(textval));
                    }
                }
            });
            $(".row_select_xl li").click(function(e){
                e = e || window.event;
                if(e.stopPropagation) {
                    e.stopPropagation();
                } else {
                    e.cancelBubble = true;
                }
                $(this).parents(".row_select_xl").hide();
            });
            //
            $(".khybj_select").click(function(e) {
                e = e || window.event;
                if(e.stopPropagation) {
                    e.stopPropagation();
                } else {
                    e.cancelBubble = true;
                }
                $(this).children(".khybj_select_xl").slideToggle(200);
                $(this).parents("td").siblings("td").find(".khybj_select_xl").hide();
                var selecttext = $(this).children("p");
                var selectmain = $(this).children(".khybj_select_xl");
                var lis = selectmain.find('li');
                for(var i = 0; i < lis.length; i++) {
                    lis[i].onclick = function() {
                        selectmain.hide();
                        var textval = $(this).html();
                        var itembId = $(this).val();
                        selecttext.text(decodeURIComponent(textval));
                        $("input[type=hidden][name=itembId]").val(itembId);
                    }
                }
            });
            $(".khybj_select_xl li").click(function(e){
                e = e || window.event;
                if(e.stopPropagation) {
                    e.stopPropagation();
                } else {
                    e.cancelBubble = true;
                }
                $(this).parents(".khybj_select_xl").hide();
            });
            //下拉框结束

            //单选框
            $(".row_rt_main .checkbox").click(function() {
                $(this).addClass("checkbox_hov").siblings(".checkbox").removeClass("checkbox_hov");
            });
            //单选框结束
        });
    </script>
</head>
<body>
<div class="njga" style="overflow: auto;">
    <form action="<c:url value='/khmc/editKhmcInfo.json'/>" method="post" id="submit_form">
        <!--考核类编辑-->
        <div class="date_pop" id="fksz_pop_bj" style="display: block;">
            <div class="khybj">
                <input type="hidden" name="dbid" value="${khmc.dbid}"/>
                <div class="row">
                    <div class="row_lf">考核域</div>
                    <div class="row_rt">
                        <div class="row_rt_main_w">
                            <div class="row_rt_main">
                                <input type="text"value="${khmc.khyName}" name="khyName" readonly="readonly"/>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="row_lf">考核类别</div>
                    <div class="row_rt">
                        <div class="row_rt_main_w">
                            <div class="khybj_select">
                                <p>${khmc.khlxName}</p>
                                <input type="hidden" name="itembId" value="${khmc.itembId}"/>
                                <div class="arrow_down"></div>
                                <ul class="khybj_select_xl">
                                    <c:forEach var="i" items="${khlxNameList}">
                                        <li value="${i.dbid}">${i.name}</li>
                                    </c:forEach>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="row_lf">考核名称</div>
                    <div class="row_rt">
                       <%--<div class="row_rt_main_w">
                            <div class="row_rt_main">
                               <input type="text"value="${khmc.name}" name="name"/>
                            </div>
                       </div>--%>
                           <textarea rows="4" style="width: 80%;box-sizing: border-box;border: 1px solid #bdc4c9;border-radius: 4px;background: #f7f7f7;resize: none;color: #333;font-size: 14px;" name="name" value="${khmc.name}">${khmc.name}</textarea>
                    </div>
                </div>
                <div class="row">
                    <div class="row_lf">分数</div>
                    <div class="row_rt">
                        <div class="row_rt_main_w">
                            <div class="row_rt_main">
                                <input type="text" value="${khmc.score}" name="score"/>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="row_lf">状态</div>
                    <div class="row_rt">
                        <input type="radio" name="status" value="1"/> 启用
                        <input type="radio" name="status" style="margin-left: 10px;" value="0"/> 禁用
                    </div>
                </div>
            </div>
        </div>
        <!--考核域编辑结束-->
    </form>
</div>
<script>
    $(function(){
        var zt = ${khmc.status};
        if(zt==1){
            $("input[type=radio][name=status][value='1']").attr('checked',true);
        }else{
            $("input[type=radio][name=status][value='0']").attr('checked',true);
        }
    });
</script>
</body>
